[org 0x7c00]

;
mov ax,3
int 0x10

; init register

mov ax,0 
mov ds,ax
mov es,ax
mov ss,ax
mov sp,0x7c00

; 普通调用
; call interrupt

; 中断调用
; mov word [0x80 * 4], interrupt
; mov word [0x80 * 4 + 2], 0
; int 0x80    ;linux 系统调用号

; 异常中断
mov word [0 * 4], interrupt
mov word [0 * 4 + 2], 0

mov dx, 0
mov ax, 1
mov bx, 0
div bx ;   dx = ax / bx

;阻塞
jmp $

interrupt:
    mov si, string
    call print
    iret


print:
    mov ah,0x0e
.next:
    mov al,[si]
    cmp al,0
    jz .done
    int 0x10
    inc si
    jmp .next
.done:
    ret

string:
    db "x",0 ;\n \r end


times 510 - ($ - $$) db 0
; dw 0xaa55
db 0x55,0xaa